package com.example.hhhh;

import android.app.Application;

import com.alibaba.android.arouter.launcher.ARouter;

/**
 * @ProjectName: Hhhh
 * @Package: com.example.hhhh
 * @ClassName: APP
 * @Description: java类作用描述
 * @Author: songhua
 * @CreateDate: 2019/12/20 0020 16:26
 */
public class APP extends Application {

    private static APP sApp;
    private boolean isDeb = true;

    @Override
    public void onCreate() {
        super.onCreate();
        if (isDeb) {
            ARouter.openLog();
            ARouter.openDebug();
        }
        sApp = APP.this;
        ARouter.init(this);

    }

    @Override
    public void onTerminate() {
        super.onTerminate();
        ARouter.getInstance().destroy();
    }

    /**
     * 获取Application上下文
     */
    public static APP getContext() {
        if (sApp == null) {
            sApp = new APP();
        }
        return sApp;
    }
}
